package uk.co.q3c.deplan.client.ui.component;

import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.ui.TextBox;

public class TextBoxDouble extends TextBox {
	private String format = "%#0.0";

	public TextBoxDouble() {
		super();
	}

	public double getDataValue() {
		return Double.parseDouble(getText());
	}

	public void setDataValue(double value) {
		setText(NumberFormat.getFormat(format)
				.format(value));
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}

}
